using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using Spacejock;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using yW5Lib;
using yWriter6.My;
using yWriter6.My.Resources;

namespace yWriter6
{
	[DesignerGenerated]
	internal class frmProjectWizard : Form
	{
		private IContainer components;

		public ToolTip ToolTip1;

		[CompilerGenerated]
		[AccessedThroughProperty("lblPath")]
		private Label _lblPath;

		[CompilerGenerated]
		[AccessedThroughProperty("lblTitle")]
		private Label _lblTitle;

		[CompilerGenerated]
		[AccessedThroughProperty("Label2")]
		private Label _Label2;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdPickPath")]
		private Button _cmdPickPath;

		[CompilerGenerated]
		[AccessedThroughProperty("txtProjectpath")]
		private TextBox _txtProjectpath;

		[CompilerGenerated]
		[AccessedThroughProperty("Label10")]
		private Label _Label10;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdBack")]
		private Button _cmdBack;

		[CompilerGenerated]
		[AccessedThroughProperty("txtAuthor")]
		private TextBox _txtAuthor;

		[CompilerGenerated]
		[AccessedThroughProperty("Label5")]
		private Label _Label5;

		[CompilerGenerated]
		[AccessedThroughProperty("txtProjTitle")]
		private TextBox _txtProjTitle;

		[CompilerGenerated]
		[AccessedThroughProperty("Label8")]
		private Label _Label8;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdCancel")]
		private Button _cmdCancel;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdNext")]
		private Button _cmdNext;

		[CompilerGenerated]
		[AccessedThroughProperty("Label1")]
		private Label _Label1;

		[CompilerGenerated]
		[AccessedThroughProperty("TabControl1")]
		private TabControl _TabControl1;

		[CompilerGenerated]
		[AccessedThroughProperty("TabPage1")]
		private TabPage _TabPage1;

		[CompilerGenerated]
		[AccessedThroughProperty("TabPage2")]
		private TabPage _TabPage2;

		[CompilerGenerated]
		[AccessedThroughProperty("TabPage3")]
		private TabPage _TabPage3;

		[CompilerGenerated]
		[AccessedThroughProperty("TabPage4")]
		private TabPage _TabPage4;

		[CompilerGenerated]
		[AccessedThroughProperty("TabPage5")]
		private TabPage _TabPage5;

		[CompilerGenerated]
		[AccessedThroughProperty("Label4")]
		private Label _Label4;

		[CompilerGenerated]
		[AccessedThroughProperty("lblAuthor")]
		private Label _lblAuthor;

		[CompilerGenerated]
		[AccessedThroughProperty("Label7")]
		private Label _Label7;

		[CompilerGenerated]
		[AccessedThroughProperty("Label3")]
		private Label _Label3;

		[CompilerGenerated]
		[AccessedThroughProperty("Label6")]
		private Label _Label6;

		[CompilerGenerated]
		[AccessedThroughProperty("optyw6")]
		private RadioButton _optyw6;

		[CompilerGenerated]
		[AccessedThroughProperty("optyw5")]
		private RadioButton _optyw5;

		public bool Cancelled;

		private int CurrentPage;

		private string DefaultPath;

		[field: AccessedThroughProperty("lblPath")]
		public virtual Label lblPath
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lblTitle")]
		public virtual Label lblTitle
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label2")]
		public virtual Label Label2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual Button cmdPickPath
		{
			[CompilerGenerated]
			get
			{
				return _cmdPickPath;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdPickPath_Click;
				Button cmdPickPath = _cmdPickPath;
				if (cmdPickPath != null)
				{
					cmdPickPath.Click -= value2;
				}
				_cmdPickPath = value;
				cmdPickPath = _cmdPickPath;
				if (cmdPickPath != null)
				{
					cmdPickPath.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("txtProjectpath")]
		public virtual TextBox txtProjectpath
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label10")]
		public virtual Label Label10
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual Button cmdBack
		{
			[CompilerGenerated]
			get
			{
				return _cmdBack;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdBack_Click;
				Button cmdBack = _cmdBack;
				if (cmdBack != null)
				{
					cmdBack.Click -= value2;
				}
				_cmdBack = value;
				cmdBack = _cmdBack;
				if (cmdBack != null)
				{
					cmdBack.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("txtAuthor")]
		public virtual TextBox txtAuthor
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label5")]
		public virtual Label Label5
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual TextBox txtProjTitle
		{
			[CompilerGenerated]
			get
			{
				return _txtProjTitle;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = txtProjTitle_TextChanged;
				TextBox txtProjTitle = _txtProjTitle;
				if (txtProjTitle != null)
				{
					txtProjTitle.TextChanged -= value2;
				}
				_txtProjTitle = value;
				txtProjTitle = _txtProjTitle;
				if (txtProjTitle != null)
				{
					txtProjTitle.TextChanged += value2;
				}
			}
		}

		[field: AccessedThroughProperty("Label8")]
		public virtual Label Label8
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		public virtual Button cmdCancel
		{
			[CompilerGenerated]
			get
			{
				return _cmdCancel;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdCancel_Click;
				Button cmdCancel = _cmdCancel;
				if (cmdCancel != null)
				{
					cmdCancel.Click -= value2;
				}
				_cmdCancel = value;
				cmdCancel = _cmdCancel;
				if (cmdCancel != null)
				{
					cmdCancel.Click += value2;
				}
			}
		}

		public virtual Button cmdNext
		{
			[CompilerGenerated]
			get
			{
				return _cmdNext;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdNext_Click;
				Button cmdNext = _cmdNext;
				if (cmdNext != null)
				{
					cmdNext.Click -= value2;
				}
				_cmdNext = value;
				cmdNext = _cmdNext;
				if (cmdNext != null)
				{
					cmdNext.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("Label1")]
		public virtual Label Label1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual TabControl TabControl1
		{
			[CompilerGenerated]
			get
			{
				return _TabControl1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = TabControl1_SelectedIndexChanged;
				TabControl tabControl = _TabControl1;
				if (tabControl != null)
				{
					tabControl.SelectedIndexChanged -= value2;
				}
				_TabControl1 = value;
				tabControl = _TabControl1;
				if (tabControl != null)
				{
					tabControl.SelectedIndexChanged += value2;
				}
			}
		}

		[field: AccessedThroughProperty("TabPage1")]
		internal virtual TabPage TabPage1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("TabPage2")]
		internal virtual TabPage TabPage2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("TabPage3")]
		internal virtual TabPage TabPage3
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("TabPage4")]
		internal virtual TabPage TabPage4
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("TabPage5")]
		internal virtual TabPage TabPage5
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label4")]
		internal virtual Label Label4
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("lblAuthor")]
		public virtual Label lblAuthor
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label7")]
		internal virtual Label Label7
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label3")]
		internal virtual Label Label3
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Label6")]
		internal virtual Label Label6
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual RadioButton optyw6
		{
			[CompilerGenerated]
			get
			{
				return _optyw6;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = RadioButton2_CheckedChanged;
				RadioButton optyw = _optyw6;
				if (optyw != null)
				{
					optyw.CheckedChanged -= value2;
				}
				_optyw6 = value;
				optyw = _optyw6;
				if (optyw != null)
				{
					optyw.CheckedChanged += value2;
				}
			}
		}

		internal virtual RadioButton optyw5
		{
			[CompilerGenerated]
			get
			{
				return _optyw5;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = RadioButton1_CheckedChanged;
				RadioButton optyw = _optyw5;
				if (optyw != null)
				{
					optyw.CheckedChanged -= value2;
				}
				_optyw5 = value;
				optyw = _optyw5;
				if (optyw != null)
				{
					optyw.CheckedChanged += value2;
				}
			}
		}

		[DebuggerNonUserCode]
		public frmProjectWizard()
		{
			base.Load += frmProjectWizard_Load;
			base.FormClosing += frmProjectWizard_FormClosing;
			InitializeComponent();
		}

		[DebuggerNonUserCode]
		protected override void Dispose(bool Disposing)
		{
			if (Disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(Disposing);
		}

		[System.Diagnostics.DebuggerStepThrough]
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
			ToolTip1 = new System.Windows.Forms.ToolTip(components);
			txtProjTitle = new System.Windows.Forms.TextBox();
			lblPath = new System.Windows.Forms.Label();
			lblTitle = new System.Windows.Forms.Label();
			Label2 = new System.Windows.Forms.Label();
			cmdPickPath = new System.Windows.Forms.Button();
			txtProjectpath = new System.Windows.Forms.TextBox();
			Label10 = new System.Windows.Forms.Label();
			cmdBack = new System.Windows.Forms.Button();
			txtAuthor = new System.Windows.Forms.TextBox();
			Label5 = new System.Windows.Forms.Label();
			Label8 = new System.Windows.Forms.Label();
			cmdCancel = new System.Windows.Forms.Button();
			cmdNext = new System.Windows.Forms.Button();
			Label1 = new System.Windows.Forms.Label();
			TabControl1 = new System.Windows.Forms.TabControl();
			TabPage1 = new System.Windows.Forms.TabPage();
			TabPage2 = new System.Windows.Forms.TabPage();
			Label4 = new System.Windows.Forms.Label();
			TabPage3 = new System.Windows.Forms.TabPage();
			Label7 = new System.Windows.Forms.Label();
			TabPage4 = new System.Windows.Forms.TabPage();
			Label3 = new System.Windows.Forms.Label();
			TabPage5 = new System.Windows.Forms.TabPage();
			Label6 = new System.Windows.Forms.Label();
			optyw6 = new System.Windows.Forms.RadioButton();
			optyw5 = new System.Windows.Forms.RadioButton();
			lblAuthor = new System.Windows.Forms.Label();
			TabControl1.SuspendLayout();
			TabPage1.SuspendLayout();
			TabPage2.SuspendLayout();
			TabPage3.SuspendLayout();
			TabPage4.SuspendLayout();
			TabPage5.SuspendLayout();
			SuspendLayout();
			txtProjTitle.AcceptsReturn = true;
			txtProjTitle.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			txtProjTitle.BackColor = System.Drawing.SystemColors.Window;
			txtProjTitle.Cursor = System.Windows.Forms.Cursors.IBeam;
			txtProjTitle.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			txtProjTitle.ForeColor = System.Drawing.SystemColors.WindowText;
			txtProjTitle.Location = new System.Drawing.Point(23, 162);
			txtProjTitle.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			txtProjTitle.MaxLength = 0;
			txtProjTitle.Name = "txtProjTitle";
			txtProjTitle.RightToLeft = System.Windows.Forms.RightToLeft.No;
			txtProjTitle.Size = new System.Drawing.Size(624, 20);
			txtProjTitle.TabIndex = 17;
			ToolTip1.SetToolTip(txtProjTitle, "Enter your project title here");
			lblPath.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			lblPath.BackColor = System.Drawing.Color.Transparent;
			lblPath.Cursor = System.Windows.Forms.Cursors.Default;
			lblPath.Font = new System.Drawing.Font("Segoe UI", 10f);
			lblPath.ForeColor = System.Drawing.SystemColors.ControlText;
			lblPath.Location = new System.Drawing.Point(10, 128);
			lblPath.Name = "lblPath";
			lblPath.RightToLeft = System.Windows.Forms.RightToLeft.No;
			lblPath.Size = new System.Drawing.Size(655, 63);
			lblPath.TabIndex = 22;
			lblPath.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			lblTitle.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			lblTitle.BackColor = System.Drawing.Color.Transparent;
			lblTitle.Cursor = System.Windows.Forms.Cursors.Default;
			lblTitle.Font = new System.Drawing.Font("Segoe UI", 10f);
			lblTitle.ForeColor = System.Drawing.SystemColors.ControlText;
			lblTitle.Location = new System.Drawing.Point(7, 53);
			lblTitle.Name = "lblTitle";
			lblTitle.RightToLeft = System.Windows.Forms.RightToLeft.No;
			lblTitle.Size = new System.Drawing.Size(659, 24);
			lblTitle.TabIndex = 20;
			lblTitle.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			Label2.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label2.BackColor = System.Drawing.Color.Transparent;
			Label2.Cursor = System.Windows.Forms.Cursors.Default;
			Label2.Font = new System.Drawing.Font("Segoe UI", 10f);
			Label2.ForeColor = System.Drawing.SystemColors.ControlText;
			Label2.Location = new System.Drawing.Point(6, 275);
			Label2.Name = "Label2";
			Label2.RightToLeft = System.Windows.Forms.RightToLeft.No;
			Label2.Size = new System.Drawing.Size(659, 64);
			Label2.TabIndex = 18;
			Label2.Text = "When you click 'Finish' you will see a blank project window. There, you can add one or more chapter files and start creating scenes. You might also like to set the autobackup method in the Tools menu.";
			cmdPickPath.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
			cmdPickPath.BackColor = System.Drawing.SystemColors.Control;
			cmdPickPath.Cursor = System.Windows.Forms.Cursors.Default;
			cmdPickPath.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			cmdPickPath.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdPickPath.Location = new System.Drawing.Point(602, 209);
			cmdPickPath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdPickPath.Name = "cmdPickPath";
			cmdPickPath.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdPickPath.Size = new System.Drawing.Size(64, 28);
			cmdPickPath.TabIndex = 19;
			cmdPickPath.Text = ". . .";
			cmdPickPath.UseVisualStyleBackColor = true;
			txtProjectpath.AcceptsReturn = true;
			txtProjectpath.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			txtProjectpath.BackColor = System.Drawing.SystemColors.Window;
			txtProjectpath.Cursor = System.Windows.Forms.Cursors.IBeam;
			txtProjectpath.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			txtProjectpath.ForeColor = System.Drawing.SystemColors.WindowText;
			txtProjectpath.Location = new System.Drawing.Point(7, 174);
			txtProjectpath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			txtProjectpath.MaxLength = 0;
			txtProjectpath.Name = "txtProjectpath";
			txtProjectpath.RightToLeft = System.Windows.Forms.RightToLeft.No;
			txtProjectpath.Size = new System.Drawing.Size(658, 20);
			txtProjectpath.TabIndex = 1;
			Label10.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label10.BackColor = System.Drawing.Color.Transparent;
			Label10.Cursor = System.Windows.Forms.Cursors.Default;
			Label10.Font = new System.Drawing.Font("Segoe UI", 10f);
			Label10.ForeColor = System.Drawing.SystemColors.ControlText;
			Label10.Location = new System.Drawing.Point(7, 78);
			Label10.Name = "Label10";
			Label10.RightToLeft = System.Windows.Forms.RightToLeft.No;
			Label10.Size = new System.Drawing.Size(659, 81);
			Label10.TabIndex = 14;
			Label10.Text = "The folder you specify must be EMPTY. If you need to create one, click the [...] button and use the 'New Folder' option on the dialog";
			Label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			cmdBack.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
			cmdBack.BackColor = System.Drawing.SystemColors.Control;
			cmdBack.Cursor = System.Windows.Forms.Cursors.Default;
			cmdBack.FlatStyle = System.Windows.Forms.FlatStyle.System;
			cmdBack.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdBack.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdBack.Location = new System.Drawing.Point(14, 445);
			cmdBack.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdBack.Name = "cmdBack";
			cmdBack.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdBack.Size = new System.Drawing.Size(118, 47);
			cmdBack.TabIndex = 2;
			cmdBack.Text = "<< Back";
			cmdBack.UseVisualStyleBackColor = true;
			txtAuthor.AcceptsReturn = true;
			txtAuthor.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			txtAuthor.BackColor = System.Drawing.SystemColors.Window;
			txtAuthor.Cursor = System.Windows.Forms.Cursors.IBeam;
			txtAuthor.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			txtAuthor.ForeColor = System.Drawing.SystemColors.WindowText;
			txtAuthor.Location = new System.Drawing.Point(66, 135);
			txtAuthor.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			txtAuthor.MaxLength = 0;
			txtAuthor.Name = "txtAuthor";
			txtAuthor.RightToLeft = System.Windows.Forms.RightToLeft.No;
			txtAuthor.Size = new System.Drawing.Size(558, 20);
			txtAuthor.TabIndex = 0;
			Label5.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label5.BackColor = System.Drawing.Color.Transparent;
			Label5.Cursor = System.Windows.Forms.Cursors.Default;
			Label5.Font = new System.Drawing.Font("Segoe UI", 10f);
			Label5.ForeColor = System.Drawing.SystemColors.ControlText;
			Label5.Location = new System.Drawing.Point(3, 77);
			Label5.Name = "Label5";
			Label5.RightToLeft = System.Windows.Forms.RightToLeft.No;
			Label5.Size = new System.Drawing.Size(666, 34);
			Label5.TabIndex = 12;
			Label5.Text = "E.g. 'Simon Haynes'";
			Label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			Label8.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label8.BackColor = System.Drawing.Color.Transparent;
			Label8.Cursor = System.Windows.Forms.Cursors.Default;
			Label8.Font = new System.Drawing.Font("Segoe UI", 10f);
			Label8.ForeColor = System.Drawing.SystemColors.ControlText;
			Label8.Location = new System.Drawing.Point(3, 67);
			Label8.Name = "Label8";
			Label8.RightToLeft = System.Windows.Forms.RightToLeft.No;
			Label8.Size = new System.Drawing.Size(669, 36);
			Label8.TabIndex = 11;
			Label8.Text = "E.g. 'Hal Junior #450 - Once more unto the well'";
			Label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			cmdCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			cmdCancel.BackColor = System.Drawing.SystemColors.Control;
			cmdCancel.Cursor = System.Windows.Forms.Cursors.Default;
			cmdCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
			cmdCancel.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdCancel.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdCancel.Location = new System.Drawing.Point(451, 445);
			cmdCancel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdCancel.Name = "cmdCancel";
			cmdCancel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdCancel.Size = new System.Drawing.Size(110, 47);
			cmdCancel.TabIndex = 3;
			cmdCancel.Text = "Cancel";
			cmdCancel.UseVisualStyleBackColor = true;
			cmdNext.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			cmdNext.BackColor = System.Drawing.SystemColors.Control;
			cmdNext.Cursor = System.Windows.Forms.Cursors.Default;
			cmdNext.FlatStyle = System.Windows.Forms.FlatStyle.System;
			cmdNext.Font = new System.Drawing.Font("Segoe UI", 10f);
			cmdNext.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdNext.Location = new System.Drawing.Point(582, 445);
			cmdNext.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdNext.Name = "cmdNext";
			cmdNext.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdNext.Size = new System.Drawing.Size(110, 47);
			cmdNext.TabIndex = 4;
			cmdNext.Text = "Next >>";
			cmdNext.UseVisualStyleBackColor = true;
			Label1.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label1.BackColor = System.Drawing.Color.Transparent;
			Label1.Cursor = System.Windows.Forms.Cursors.Default;
			Label1.Font = new System.Drawing.Font("Segoe UI", 10f);
			Label1.ForeColor = System.Drawing.SystemColors.ControlText;
			Label1.Location = new System.Drawing.Point(14, 140);
			Label1.Name = "Label1";
			Label1.RightToLeft = System.Windows.Forms.RightToLeft.No;
			Label1.Size = new System.Drawing.Size(639, 133);
			Label1.TabIndex = 6;
			Label1.Text = "This wizard will help you set up a yWriter project. Fill in the required fields and click Next to progress through the wizard. At the end, click Finish.";
			TabControl1.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			TabControl1.Controls.Add(TabPage1);
			TabControl1.Controls.Add(TabPage2);
			TabControl1.Controls.Add(TabPage3);
			TabControl1.Controls.Add(TabPage4);
			TabControl1.Controls.Add(TabPage5);
			TabControl1.ItemSize = new System.Drawing.Size(90, 26);
			TabControl1.Location = new System.Drawing.Point(9, 15);
			TabControl1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabControl1.Name = "TabControl1";
			TabControl1.SelectedIndex = 0;
			TabControl1.Size = new System.Drawing.Size(682, 409);
			TabControl1.TabIndex = 17;
			TabPage1.Controls.Add(Label1);
			TabPage1.Location = new System.Drawing.Point(4, 30);
			TabPage1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage1.Name = "TabPage1";
			TabPage1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage1.Size = new System.Drawing.Size(674, 375);
			TabPage1.TabIndex = 0;
			TabPage1.Text = "Welcome";
			TabPage1.UseVisualStyleBackColor = true;
			TabPage2.Controls.Add(Label4);
			TabPage2.Controls.Add(txtProjTitle);
			TabPage2.Controls.Add(Label8);
			TabPage2.Location = new System.Drawing.Point(4, 30);
			TabPage2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage2.Name = "TabPage2";
			TabPage2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage2.Size = new System.Drawing.Size(674, 375);
			TabPage2.TabIndex = 1;
			TabPage2.Text = "Step 1";
			TabPage2.UseVisualStyleBackColor = true;
			Label4.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label4.Font = new System.Drawing.Font("Arial", 13.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			Label4.Location = new System.Drawing.Point(0, 10);
			Label4.Name = "Label4";
			Label4.Size = new System.Drawing.Size(673, 63);
			Label4.TabIndex = 18;
			Label4.Text = "Please enter the project title";
			Label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			TabPage3.Controls.Add(Label5);
			TabPage3.Controls.Add(Label7);
			TabPage3.Controls.Add(txtAuthor);
			TabPage3.Location = new System.Drawing.Point(4, 30);
			TabPage3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage3.Name = "TabPage3";
			TabPage3.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage3.Size = new System.Drawing.Size(674, 375);
			TabPage3.TabIndex = 2;
			TabPage3.Text = "Step 2";
			TabPage3.UseVisualStyleBackColor = true;
			Label7.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label7.Font = new System.Drawing.Font("Arial", 13.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			Label7.Location = new System.Drawing.Point(0, 0);
			Label7.Name = "Label7";
			Label7.Size = new System.Drawing.Size(673, 89);
			Label7.TabIndex = 19;
			Label7.Text = "Next, please enter the author's name";
			Label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			TabPage4.Controls.Add(Label10);
			TabPage4.Controls.Add(Label3);
			TabPage4.Controls.Add(cmdPickPath);
			TabPage4.Controls.Add(txtProjectpath);
			TabPage4.Location = new System.Drawing.Point(4, 30);
			TabPage4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage4.Name = "TabPage4";
			TabPage4.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage4.Size = new System.Drawing.Size(674, 375);
			TabPage4.TabIndex = 3;
			TabPage4.Text = "Step 3";
			TabPage4.UseVisualStyleBackColor = true;
			Label3.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			Label3.Font = new System.Drawing.Font("Arial", 13.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			Label3.Location = new System.Drawing.Point(0, 4);
			Label3.Name = "Label3";
			Label3.Size = new System.Drawing.Size(673, 89);
			Label3.TabIndex = 20;
			Label3.Text = "Now specify your project folder";
			Label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
			TabPage5.Controls.Add(Label6);
			TabPage5.Controls.Add(optyw6);
			TabPage5.Controls.Add(optyw5);
			TabPage5.Controls.Add(lblPath);
			TabPage5.Controls.Add(Label2);
			TabPage5.Controls.Add(lblAuthor);
			TabPage5.Controls.Add(lblTitle);
			TabPage5.Location = new System.Drawing.Point(4, 30);
			TabPage5.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage5.Name = "TabPage5";
			TabPage5.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
			TabPage5.Size = new System.Drawing.Size(674, 375);
			TabPage5.TabIndex = 4;
			TabPage5.Text = "Finished";
			TabPage5.UseVisualStyleBackColor = true;
			Label6.AutoSize = true;
			Label6.Location = new System.Drawing.Point(42, 194);
			Label6.Name = "Label6";
			Label6.Size = new System.Drawing.Size(237, 19);
			Label6.TabIndex = 24;
			Label6.Text = "Project format (RTF is recommended):";
			optyw6.AutoSize = true;
			optyw6.Location = new System.Drawing.Point(333, 220);
			optyw6.Name = "optyw6";
			optyw6.Size = new System.Drawing.Size(140, 23);
			optyw6.TabIndex = 23;
			optyw6.Text = "Markup Text (yw6)";
			optyw6.UseVisualStyleBackColor = true;
			optyw5.AutoSize = true;
			optyw5.Checked = true;
			optyw5.Location = new System.Drawing.Point(333, 191);
			optyw5.Name = "optyw5";
			optyw5.Size = new System.Drawing.Size(85, 23);
			optyw5.TabIndex = 23;
			optyw5.TabStop = true;
			optyw5.Text = "RTF (yw5)";
			optyw5.UseVisualStyleBackColor = true;
			lblAuthor.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right);
			lblAuthor.BackColor = System.Drawing.Color.Transparent;
			lblAuthor.Cursor = System.Windows.Forms.Cursors.Default;
			lblAuthor.Font = new System.Drawing.Font("Segoe UI", 10f);
			lblAuthor.ForeColor = System.Drawing.SystemColors.ControlText;
			lblAuthor.Location = new System.Drawing.Point(7, 90);
			lblAuthor.Name = "lblAuthor";
			lblAuthor.RightToLeft = System.Windows.Forms.RightToLeft.No;
			lblAuthor.Size = new System.Drawing.Size(659, 24);
			lblAuthor.TabIndex = 20;
			lblAuthor.TextAlign = System.Drawing.ContentAlignment.TopCenter;
			base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			BackColor = System.Drawing.SystemColors.Control;
			base.ClientSize = new System.Drawing.Size(705, 507);
			base.Controls.Add(TabControl1);
			base.Controls.Add(cmdBack);
			base.Controls.Add(cmdCancel);
			base.Controls.Add(cmdNext);
			Cursor = System.Windows.Forms.Cursors.Default;
			Font = new System.Drawing.Font("Segoe UI", 10f);
			base.Location = new System.Drawing.Point(4, 23);
			base.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			MinimumSize = new System.Drawing.Size(673, 524);
			base.Name = "frmProjectWizard";
			RightToLeft = System.Windows.Forms.RightToLeft.No;
			base.ShowInTaskbar = false;
			base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
			Text = "Welcome to the yWriter setup wizard";
			TabControl1.ResumeLayout(false);
			TabPage1.ResumeLayout(false);
			TabPage2.ResumeLayout(false);
			TabPage2.PerformLayout();
			TabPage3.ResumeLayout(false);
			TabPage3.PerformLayout();
			TabPage4.ResumeLayout(false);
			TabPage4.PerformLayout();
			TabPage5.ResumeLayout(false);
			TabPage5.PerformLayout();
			ResumeLayout(false);
		}

		private void cmdBack_Click(object eventSender, EventArgs eventArgs)
		{
			CurrentPage--;
			DisplayCurrentPage();
		}

		private void cmdCancel_Click(object eventSender, EventArgs eventArgs)
		{
			Cancelled = true;
			Hide();
		}

		private void cmdNext_Click(object eventSender, EventArgs eventArgs)
		{
			if (ConfirmPageOK())
			{
				clsShared.cLog.LogEvent("Currentpage: " + Conversions.ToString(CurrentPage) + " number pages: " + Conversions.ToString(TabControl1.TabPages.Count));
				if (CurrentPage == TabControl1.TabPages.Count - 1)
				{
					Cancelled = false;
					Hide();
				}
				else
				{
					CurrentPage++;
					DisplayCurrentPage();
				}
			}
		}

		private void cmdPickPath_Click(object eventSender, EventArgs eventArgs)
		{
			try
			{
				string path = clsShared.cFileSel.GetPath(DefaultPath, BlankOnCancel: true);
				if (Operators.CompareString(path, "", TextCompare: false) != 0)
				{
					DefaultPath = clsShared.cFile.AddSlashIfMissing(path);
					txtProjectpath.Text = DefaultPath;
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private void frmProjectWizard_Load(object eventSender, EventArgs eventArgs)
		{
			base.Icon = Resources.yWriter5_Ico;
			try
			{
				if (clsShared.cFile.FolderExists(clsShared.cSpecialFolders.MyDocsFolder))
				{
					DefaultPath = Path.Combine(clsShared.cSpecialFolders.MyDocsFolder, "yWriter Projects");
				}
				else
				{
					DefaultPath = clsShared.cFile.DriveOnly(MyProject.Computer.FileSystem.SpecialDirectories.ProgramFiles) + ":\\yWriter Projects";
				}
				txtProjectpath.Text = DefaultPath;
				clsShared.cFile.MkMissingDir(txtProjectpath.Text);
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
			CurrentPage = 0;
			DisplayCurrentPage();
			try
			{
				if (Operators.CompareString(clsShared.cLang.CurrentLanguage, "English", TextCompare: false) != 0)
				{
					clsShared.cLang.TranslateForm(this);
				}
			}
			catch (Exception ex3)
			{
				ProjectData.SetProjectError(ex3);
				Exception ex4 = ex3;
				clsShared.cLog.AddAction(ex4, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
			clsShared.cFormFont.SetFormFont(this, clsShared.cSettings.sGet("FormFont", modVariables.DefaultUIFont.Name), clsShared.cSettings.sGet("UIFontSize", modVariables.DefaultUIFont.Size));
		}

		private void DisplayCurrentPage()
		{
			if (CurrentPage < 0)
			{
				CurrentPage = 0;
			}
			if (CurrentPage >= TabControl1.TabPages.Count)
			{
				CurrentPage = TabControl1.TabPages.Count - 1;
			}
			cmdNext.Text = "Next >>";
			if (CurrentPage == 0)
			{
				cmdBack.Visible = false;
			}
			else if (CurrentPage == TabControl1.TabPages.Count - 1)
			{
				cmdNext.Text = "Finish";
			}
			else
			{
				cmdBack.Visible = true;
			}
			TabControl1.SelectTab(CurrentPage);
			switch (CurrentPage)
			{
			case 1:
				txtProjTitle.Focus();
				break;
			case 2:
				txtAuthor.Focus();
				break;
			case 3:
				txtProjectpath.Focus();
				break;
			case 4:
				lblAuthor.Text = "Author: " + txtAuthor.Text;
				lblTitle.Text = "Title: " + txtProjTitle.Text;
				DisplayProjectFile();
				break;
			}
			cDelay.DoEvents();
		}

		private bool ConfirmPageOK()
		{
			//Discarded unreachable code: IL_0247, IL_0253, IL_0266, IL_026b, IL_0276, IL_0286, IL_0344, IL_0346, IL_035a, IL_037c
			int num = default(int);
			bool result = false;
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				result = true;
				num2 = 3;
				switch (CurrentPage)
				{
				case 0:
					break;
				case 1:
					num2 = 6;
					if (Operators.CompareString(Strings.Trim(txtProjTitle.Text), "", TextCompare: false) == 0)
					{
						num2 = 7;
						result = false;
						num2 = 8;
						clsShared.cLang.TransMsgBox("Please specify a project title");
					}
					break;
				case 2:
					num2 = 10;
					if (Operators.CompareString(Strings.Trim(txtAuthor.Text), "", TextCompare: false) == 0)
					{
						num2 = 11;
						result = false;
						num2 = 12;
						clsShared.cLang.TransMsgBox("Please specify the author's name");
					}
					break;
				case 3:
					num2 = 14;
					if (Operators.CompareString(txtProjectpath.Text.Trim(), "", TextCompare: false) == 0)
					{
						num2 = 15;
						result = false;
						num2 = 16;
						clsShared.cLang.TransMsgBox("Please specify a path to store the project in");
					}
					else
					{
						num2 = 18;
						if (txtProjectpath.Text.Length <= 3)
						{
							num2 = 19;
							result = false;
							num2 = 20;
							clsShared.cLang.TransMsgBox("Please specify a path to store the project in (E.g. C:\\My Documents\\New Project\\");
						}
						else
						{
							num2 = 22;
							if (txtProjectpath.Text.StartsWith("\\") & !txtProjectpath.Text.StartsWith("\\\\"))
							{
								num2 = 23;
								result = false;
								num2 = 24;
								clsShared.cLang.TransMsgBox("You must specify the FULL path. E.g. 'C:\\yWriter Projects\\My Project\\', not just '\\My Project\\'");
							}
							else
							{
								num2 = 26;
								if (!clsShared.cFile.FolderExists(txtProjectpath.Text))
								{
									num2 = 27;
									if (clsShared.cLang.TransMsgBox("The project path does not exist. Do you want to create it?", MsgBoxStyle.YesNo) == MsgBoxResult.No)
									{
										num2 = 28;
										result = false;
									}
									else
									{
										num2 = 30;
										clsShared.cFile.MkMissingDir(txtProjectpath.Text);
										num2 = 31;
										txtProjectpath.Text = clsShared.cFile.AddSlashIfMissing(txtProjectpath.Text);
									}
								}
								else
								{
									num2 = 33;
									if (clsShared.cFile.FolderExists(yW5Lib.modSubs.RTFPathV5(txtProjectpath.Text)))
									{
										num2 = 34;
										clsShared.cLang.TransMsgBox("There's already a project in that folder. Please choose another location.");
										num2 = 35;
										result = false;
									}
									else
									{
										num2 = 37;
										txtProjectpath.Text = clsShared.cFile.AddSlashIfMissing(txtProjectpath.Text);
									}
								}
							}
						}
					}
					break;
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_037a: Could not find block for branch target IL_0346*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
			return result;
		}

		private void frmProjectWizard_FormClosing(object eventSender, FormClosingEventArgs eventArgs)
		{
			if (eventArgs.CloseReason == CloseReason.UserClosing)
			{
				clsShared.cLog.AddAction("Wizard form closed");
				Cancelled = true;
			}
		}

		private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
		{
			TabControl1.SelectedIndex = CurrentPage;
		}

		private string CleanFile()
		{
			string text = "NewProject";
			if (txtProjTitle.Text.Length != 0)
			{
				try
				{
					text = clsShared.cFile.StripBadFileChar(txtProjTitle.Text).Trim();
					if (Strings.Len(text) <= 30)
					{
						return text;
					}
					text = Strings.Left(text, 30);
					return text;
				}
				catch (Exception ex)
				{
					ProjectData.SetProjectError(ex);
					Exception ex2 = ex;
					ProjectData.ClearProjectError();
					return text;
				}
			}
			return text;
		}

		private void txtProjTitle_TextChanged(object sender, EventArgs e)
		{
			try
			{
				txtProjectpath.Text = clsShared.cFile.AddSlashIfMissing(DefaultPath) + clsShared.cFile.AddSlashIfMissing(CleanFile().Trim());
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}

		private void RadioButton1_CheckedChanged(object sender, EventArgs e)
		{
			DisplayProjectFile();
		}

		private void DisplayProjectFile()
		{
			if (optyw5.Checked)
			{
				lblPath.Text = clsShared.cFile.AddSlashIfMissing(txtProjectpath.Text) + CleanFile().Trim() + ".yw5";
			}
			else
			{
				lblPath.Text = clsShared.cFile.AddSlashIfMissing(txtProjectpath.Text) + CleanFile().Trim() + ".yw6";
			}
		}

		private void RadioButton2_CheckedChanged(object sender, EventArgs e)
		{
			DisplayProjectFile();
		}
	}
}
